package com.example.demo.service.impl;

import com.example.demo.dao.TestMapper;
import com.example.demo.models.Test;
import com.example.demo.service.ITestService;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author Liunh
 */
@Service
public class TestServiceImpl implements ITestService {

    private final TestMapper testMapper;

    public TestServiceImpl(TestMapper testMapper) {
        this.testMapper = testMapper;
    }

    @Override
    public int insert(Test req) {
        req.setCreateTime(new Date());
        return testMapper.insert(req);
    }

    @Override
    public int update(Test req) {
        return testMapper.update(req);
    }

    @Override
    public int delete(Integer id) {
        return testMapper.delete(id);
    }

    @Override
    public List<Test> findList(Test req) {
        return testMapper.findList(req);
    }
}
